<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no"/>
		<title>出入站待办列表</title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
		<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
		<link rel="stylesheet" type="text/css" href="../../css/common.css"/>
		<link rel="stylesheet" href="../../script/ccssoft/css/ccssoft-lite.css" />
		<link rel="stylesheet" href="../../css/vueComponent.css" />
		<style>
			.aui-flex-col:first-child {
				height: 30px;
				line-height: 30px;
				border-bottom: 1px solid #999;
			}
			.aui-flex-col {
				height: 25px;
				line-height: 25px;
			}
			.ccssoft_list {
				background-color: #eff1f0;
				override: hidden;
			}
			.ccssoft_list {
				margin-top: 15px;
			}
			.ccssoft_list li {
				list-style: none;
				border-bottom: 1px solid #e3e2e2;
				background: #fff;
				overflow: hidden;
				margin-bottom: 10px;
			}
			.ccssoft_list li:hover {
				background: #f9e9df;
			}
			.ccssoft_list li.acitve {
				background: #f9e9df;
			}
		</style>
	</head>
	<body>
		<!-- <script id="listView-template" type="text/x-dot-template">
		{{ for(var i=0, len=it.length; i < len; i++) {
		var processflag = it[i].processflag;
		var processflagName = "";
		var pcolor = "";
		if(processflag=="ACCEPT"){
		processflagName = "接单";
		pcolor = "#22AADD";
		}else if(processflag=="AUDIT"){
		processflagName = "审批";
		pcolor = "#1cc472";
		}else if(processflag=="COORDINATE"){
		processflagName = "协调上站";
		pcolor = "#7676BA";
		}else if(processflag=="REVERT"){
		processflagName = "回单";
		pcolor = "#B372F6";
		}else if(processflag=="ISPROMPT"){
		processflagName = "是否及时上站";
		pcolor = "#E088CF";
		}else if(processflag=="ISAGREE"){
		processflagName = "是否同意";
		pcolor = "#AED684";
		}else if(processflag=="SENISPROMPT"){
		processflagName = "最终确认";
		pcolor = "#E088CF";
		}else if(processflag=="PHONESIGN"){
		processflagName = "手机签到";
		pcolor = "#9fbe3b";
		}else if(processflag=="ARCHIVE"){
		processflagName = "归档";
		pcolor = "#953A6C";
		}else if(processflag=="CONFIRE"){
		processflagName = "上站确认";
		pcolor = "#fb8536";
		}
		}}
		<li tapmode="active" applyId="{{=it[i].applyid}}" stationId="{{=it[i].stationid}}" stationName="{{=it[i].stationname}}" isneedperson="{{=it[i].isneedperson}}" applyisneedperson="{{=it[i].applyisneedperson}}"  onclick="openStandBillDetail(this)">
		<div class="liTop">
		{{=it[i].stationname ? it[i].stationname : '&nbsp;'}}
		{{?it[i].isneedperson=="Y"}}
		<span class="hasFellow" style="color:#4AB518;">随工</span>
		{{?}}
		{{?it[i].isneedperson== null }}
		{{?it[i].applyisneedperson=='Y'}}
		<span class="hasFellow" style="color:#4AB518;">随工</span>
		{{?}}
		{{?}}
		{{?it[i].isneedperson=="N"}}
		<span class="hasFellow" style="color:#F4AB15;">不随工</span>
		{{?}}
		{{?it[i].isneedperson==null }}
		{{?it[i].applyisneedperson=='N'}}
		<span class="hasFellow" style="color:#F4AB15;">不随工</span>
		{{?}}
		{{?}}
		<span class="billStatus" style="color:{{=pcolor}}">{{=processflagName}}</span>
		</div>
		<div class="liMiddle">
		{{=it[i].applyid}}
		<span class="bugType" style="color:{{=it[i].cause == '1'?'#ff3333':'#000'}}">
		{{? it[i].cause == '1' }}
		紧急故障处理
		{{?}}
		{{? it[i].cause == '2' }}
		一般故障处理
		{{?}}
		{{? it[i].cause == '3' }}
		安装设备
		{{?}}
		{{? it[i].cause == '4' }}
		勘察设计
		{{?}}
		{{? it[i].cause == '5' }}
		日常巡检
		{{?}}
		{{? it[i].cause == '6' }}
		其它
		{{?}}
		</span>
		</div>
		<div class="liDown">
		申请上站时间：{{=it[i].applystanddate != null ? it[i].applystanddate:''}}
		<span class="dealPerson">{{=it[i].contact_person != null ? it[i].contact_person:''}}</span>
		</div>
		</li>
		{{ } }}
		</script>-->
		<script id="listView-template" type="text/x-dot-template">
			{{ for(var i=0, len=it.length; i < len; i++) {
			var processflag = it[i].processflag;
			var processflagName = "";
			var pcolor = "";
			if(processflag=="ACCEPT"){
			processflagName = "接单";
			pcolor = "#22AADD";
			}else if(processflag=="AUDIT"){
			processflagName = "审批";
			pcolor = "#1cc472";
			}else if(processflag=="COORDINATE"){
			processflagName = "协调上站";
			pcolor = "#7676BA";
			}else if(processflag=="REVERT"){
			processflagName = "回单";
			pcolor = "#B372F6";
			}else if(processflag=="ISPROMPT"){
			processflagName = "是否及时上站";
			pcolor = "#E088CF";
			}else if(processflag=="ISAGREE"){
			processflagName = "是否同意";
			pcolor = "#AED684";
			}else if(processflag=="SENISPROMPT"){
			processflagName = "最终确认";
			pcolor = "#E088CF";
			}else if(processflag=="PHONESIGN"){
			processflagName = "手机签到";
			pcolor = "#9fbe3b";
			}else if(processflag=="ARCHIVE"){
			processflagName = "归档";
			pcolor = "#953A6C";
			}else if(processflag=="CONFIRE"){
			processflagName = "上站确认";
			pcolor = "#fb8536";
			}else if(processflag=="LEAVECONFIRM"){
			processflagName = "离站确认";
			pcolor = "#3693fb";
			}
			}}
			<li class="aui-content" style="padding:8px;" tapmode="active" applyId="{{=it[i].applyid}}" stationId="{{=it[i].stationid}}" stationName="{{=it[i].stationname}}" isneedperson="{{=it[i].isneedperson}}" applyisneedperson="{{=it[i].applyisneedperson}}"  onclick="openStandBillDetail(this)">
			<div class="aui-flex-col" style="border-bottom: 1px dashed #00a0c8;">
			<div class="aui-flex-item-6" style="font-weight: bold;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"> {{=it[i].stationname ? it[i].stationname : '&nbsp;'}}</div>
			{{?it[i].isneedperson=="Y" || (it[i].isneedperson == 'null' && it[i].applyisneedperson=='Y')}}
			<div class="aui-flex-item-2 aui-text-right" style="color:#4AB518;">随工</div>
			{{?}}
			{{?it[i].isneedperson=="N" || (it[i].isneedperson == 'null' && it[i].applyisneedperson=='N')}}
			<div class="aui-flex-item-2 aui-text-right" style="color:#F4AB15">不随工</div>
			{{?}}
			<div class="aui-flex-item-4 aui-text-right" style="color:{{=pcolor}}">{{=processflagName}}</div>
			</div>
			<div class="aui-flex-col" style="font-size:12px;">
			<div class="aui-flex-item-7"> {{=it[i].applyid}}</div>
			<div class="aui-flex-item-5 aui-text-right" style="color:{{=it[i].cause == '1'?'#ff3333':'#000'}}">

			{{? it[i].cause == '1' }}
			抢修（紧急故障处理）
			{{?? it[i].cause == '2' }}
			排障（一般故障处理）
			{{?? it[i].cause == '3' }}
			施工（安装设备）
			{{?? it[i].cause == '4' }}
			勘察
			{{?? it[i].cause == '5' }}
			巡检
			{{?? it[i].cause == '6' }}
			发电
			{{?? it[i].cause == '7' }}
			检查
			{{?? it[i].cause == '8' }}
			保障
			{{?? it[i].cause == '99' }}
			其他
			{{??}}
			其它
			{{?}}

			</div>
			</div>
			<div class="aui-flex-col" style="font-size:12px;">
			<div class="aui-flex-item-9">申请上站时间：{{=it[i].applystanddate != null ? it[i].applystanddate:''}}</div>
			<div class="aui-flex-item-3 aui-text-right">{{=it[i].contact_person != null ? it[i].contact_person:''}}</div>
			</div>
			</li>
			{{ } }}
		</script>
		<div class="aui-content">
			<div id="app" v-cloak hide style="height: 40px;line-height:40px;background-color: white;position: relative;border-bottom: rgb(226,226,226) solid 1px;border-top: rgb(226,226,226) solid 1px" class="vue-dropdown">
				<label @click="active = !active" style="z-index: 10001;"><span style="margin-left: 20px">{{selectedItem.label}}</span><span class="dropdown-title" :class="[active?'active':'']"></span></label>
				<yt-mask :show.sync="active" @click-shadow="active = false" top="80px">
					<div class="list-container" v-show="active">
						<ul><li v-for="item in dataList" :key="item.id" @click="change(item,true)" :class="[value === item.value ? 'active' : '']"><span class="checked-badge" ></span>{{item.label}}</li></ul>
					</div>
				</yt-mask>
			</div>
			<ul class="ccssoft_list" id="listView"></ul>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/debug.js"></script>
	<script type="text/javascript" src="../../script/constant.js"></script>
	<script type="text/javascript" src="../../script/config.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/navigate.js"></script>
	<script type="text/javascript" src="../../script/doT.min.js"></script>
	<script type="text/javascript" src="../../script/ccssoft/js/ccssoft-lite.js"></script>
	<script type="text/javascript" src="../../script/vue.js"></script>
	<script type="text/javascript" src="../../script/vueComponent.js"></script>
	<script type="text/javascript" src="../../script/client.api.js"></script>
	<script type="text/javascript" src="../../script/aui-alert.js"></script>
	<script type="text/javascript">

		var app = new Vue({
			el:'#app',
			mixins:[ORDER_OPTIONS_MIXIN],
			mounted(){
				this.init();
			},
			methods:{
				init(){
					this.active = false;
					this.change(this.dataList[0]);
				},
				change(item,refresh = false) {
					this.selectedItem = item;
					this.value = item.value;
					this.active = false;
					if(refresh){
						listView.setQueryOptions({
							sortCond:this.value
						});
						// alert(JSON.stringify(listView.queryOptions))
						listView.refresh();
					}
				}
			}
		});

		var beforeRefresh = function(obj,call){
			if(app){
				app.init();
				obj.setQueryOptions({
					sortCond:app.value
				});
			}
			call(true);
		}

		var listView;
		var isTest = $api.getStorage("curServer");
		apiready = function() {
			if(api.pageParam.type=='RL_STATION'){
				var Newtime=$api.getStorage('Newtime');
				listView = new C.ApiListView({
					fn : $client.getStationCalendar,
					beforeRefresh:beforeRefresh
				});
				listView.setQueryOptions({
					date:Newtime
				})
			}else {
				listView = new C.ApiListView({
					fn : $client.getStandBillList,
					beforeRefresh:beforeRefresh
				});
			}

			listView.setQueryOptions({
				sortCond:app.value
			});

			listView.refresh();
		};
		function openStandBillDetail(el) {
			showlog("isneedperson=" + $api.attr(el, 'isneedperson') + '， applyisneedperson＝' + $api.attr(el, 'applyisneedperson'));
			var applyId = $api.attr(el, 'applyId');
			var stationId = $api.attr(el, 'stationId');
			var stationName = $api.attr(el, 'stationName');
			var pageParam = {};
			pageParam.applyId = applyId;
			pageParam.stationId = stationId;
			pageParam.stationName = stationName;
			//页面来源，这里表示从上站待办跳过来
			pageParam.fromPage = "standBillListWin";
			api.openWin({
				name : 'mainStandBillDetail',
				url : 'mainStandBillDetail.html',
				opaque : true,
				bounces : false,
				reload : true,
				pageParam : pageParam,
				vScrollBarEnabled : false
			});
		}
	</script>
</html>
